/*  1:   */ package gcs.com.util;
/*  2:   */ 
/*  3:   */ import java.io.PrintStream;
/*  4:   */ import javax.xml.namespace.QName;
/*  5:   */ import org.apache.axis2.addressing.EndpointReference;
/*  6:   */ import org.apache.axis2.client.Options;
/*  7:   */ import org.apache.axis2.rpc.client.RPCServiceClient;
/*  8:   */ 
/*  9:   */ public class Axis2Utils
/* 10:   */ {
/* 11:   */   public static String sendWebServiceMsg(Object[] os, String namespace, String method, String url)
/* 12:   */     throws Exception
/* 13:   */   {
/* 14:14 */     String msg = "";
/* 15:15 */     RPCServiceClient serviceClient = null;
/* 16:   */     try
/* 17:   */     {
/* 18:18 */       serviceClient = new RPCServiceClient();
/* 19:19 */       Options options = serviceClient.getOptions();
/* 20:20 */       options.setManageSession(true);
/* 21:21 */       options.setProperty("REUSE_HTTP_CLIENT", Boolean.valueOf(true));
/* 22:   */       
/* 23:23 */       EndpointReference targetEPR = new EndpointReference(
/* 24:24 */         url);
/* 25:25 */       options.setTo(targetEPR);
/* 26:   */       
/* 27:27 */       Class[] responseParam = { String.class };
/* 28:   */       
/* 29:29 */       QName requestMethod = new QName(namespace, 
/* 30:30 */         method);
/* 31:   */       
/* 32:32 */       msg = serviceClient.invokeBlocking(requestMethod, os, 
/* 33:33 */         responseParam)[0].toString();
/* 34:   */     }
/* 35:   */     catch (Exception e)
/* 36:   */     {
/* 37:35 */       e.printStackTrace();
/* 38:36 */       throw e;
/* 39:   */     }
/* 40:   */     finally
/* 41:   */     {
/* 42:39 */       if (serviceClient != null) {
/* 43:40 */         serviceClient.cleanupTransport();
/* 44:   */       }
/* 45:   */     }
/* 46:43 */     return msg;
/* 47:   */   }
/* 48:   */   
/* 49:   */   public static void main(String[] args)
/* 50:   */   {
/* 51:48 */     Object[] os = { "测试", "b778fb598c717c0ad7ea8c97c8f3a46f", "V100001" };
/* 52:   */     try
/* 53:   */     {
/* 54:50 */       String msg = sendWebServiceMsg(os, "http://server.com.gcs/", "vss_server", "http://127.0.0.1:8080/AppCustomProtocolServer/AppCPServerPort?wsdl");
/* 55:51 */       System.out.println(msg);
/* 56:   */     }
/* 57:   */     catch (Exception e)
/* 58:   */     {
/* 59:53 */       e.printStackTrace();
/* 60:   */     }
/* 61:   */   }
/* 62:   */ }


/* Location:           C:\Users\zhoubo\Desktop\classes\
 * Qualified Name:     gcs.com.util.Axis2Utils
 * JD-Core Version:    0.7.0.1
 */